<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <meta http-equiv="Content-Language" content="zh-cn">
        <meta name="apple-mobile-web-app-capable" content="no"/>
        <meta name="apple-touch-fullscreen" content="yes"/>
        <meta name="format-detection" content="telephone=no,email=no"/>
        <meta name="apple-mobile-web-app-status-bar-style" content="white"/>
        <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"/>
        <meta http-equiv="Expires" content="0"/>
        <meta http-equiv="Pragma" content="no-cache"/>
        <meta http-equiv="Cache-control" content="no-cache"/>
        <meta http-equiv="Cache" content="no-cache"/>
        <meta name="viewport"  content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
        <title>微信扫码</title>
        <script src="/ewm/img/jquery-1.8.0.js" type="text/javascript"></script>
        <style type="text/css">
            @charset "UTF-8";
            html {
                font-size: 62.5%;
                font-family: 'helvetica neue', tahoma, arial, 'hiragino sans gb', 'microsoft yahei', 'Simsun', sans-serif
            }

            body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, button, textarea, p, blockquote, th, td, hr {
                margin: 0;
                padding: 0px 2px;
            }

            body {
                line-height: 1.333;
                font-size: 12px
            }

            h1, h2, h3, h4, h5, h6 {
                font-size: 100%;
                font-family: arial, 'hiragino sans gb', 'microsoft yahei', 'Simsun', sans-serif
            }

            input, textarea, select, button {
                font-size: 12px;
                font-weight: normal
            }

            input[type="button"], input[type="submit"], select, button {
                cursor: pointer
            }

            table {
                border-collapse: collapse;
                border-spacing: 0
            }

            address, caption, cite, code, dfn, em, th, var {
                font-style: normal;
                font-weight: normal
            }

            li {
                list-style: none
            }

            caption, th {
                text-align: left
            }

            q:before, q:after {
                content: ''
            }

            abbr, acronym {
                border: 0;
                font-variant: normal
            }

            sup {
                vertical-align: text-top
            }

            sub {
                vertical-align: text-bottom
            }

            fieldset, img, a img, iframe {
                border-width: 0;
                border-style: none
            }

            img {
                -ms-interpolation-mode: bicubic
            }

            textarea {
                overflow-y: auto
            }

            legend {
                color: #000
            }

            a:link, a:visited {
                text-decoration: none
            }

            hr {
                height: 0
            }

            label {
                cursor: pointer
            }

            a {
                color: #328CE5
            }

            a:hover {
                color: #2b8ae8;
                text-decoration: none
            }

            a:focus {
                outline: none
            }

            body, .body {
                background: #f7f7f7;
                height: 100%;
                max-width: 640px;
                min-width: 300px;
                min-height: 100%;

                margin: 0 auto;
            }

            .mod-title {
                height: 60px;
                line-height: 60px;
                text-align: center;
                border-bottom: 1px solid #ddd;
                background: #fff
            }

            .ico_log {
                display: inline-block;
                width: 130px;
                height: 38px;
                vertical-align: middle;
                margin-right: 7px
            }

            .ico-1 {
                background: url("/ewm/img/logo_alipay.jpg") no-repeat;
                background-size: cover;
            }

            .ico-2 {
                background: url("/ewm/img/banner_qqpay.jpg") no-repeat;
            }

            .ico-3 {
                background: url("/ewm/img/logo_weixin.jpg") no-repeat;
                background-size: cover;
            }

            .mod-title .text {
                font-size: 20px;
                color: #333;
                font-weight: normal;
                vertical-align: middle
            }

            .mod-ct {
                min-width: 300px;
                max-width: 640px;
                margin: 0 auto;
                margin-top: 15px;
                margin-bottom: 15px;
                padding-bottom: 10px;
                background: #fff url("/ewm/img/wave.png") top center repeat-x;
                text-align: center;
                color: #333;
                border: 1px solid #e5e5e5;
                border-top: none
            }

            .mod-ct .order {
                font-size: 20px;
                padding-top: 10px
            }

            .mod-ct .amount {
                font-size: 50px;
                margin-top: 10px;
                font-weight: 700;
            }

            .mod-ct .qr-image {
                margin-top: 30px
            }

            .mod-ct .qr-image img {
                width: 230px;
                height: 230px
            }

            .mod-ct .detail {
                margin-top: 10px;
                padding-top: 0px;
                padding-bottom: 10px;

            }

            .mod-ct .detail .arrow .ico-arrow {
                display: inline-block;
                width: 20px;
                height: 11px;
                background: url("/ewm/img/wechat-pay.png") -25px -100px no-repeat
            }

            .mod-ct .detail .detail-ct {
                display: none;
                font-size: 12px;
                text-align: right;
                line-height: 28px
            }

            .mod-ct .detail .detail-ct dt {
                float: left
            }

            .mod-ct .detail-open {
                border-top: 1px solid #e5e5e5
            }

            .mod-ct .detail .arrow {
                padding: 6px 34px;
                border: 1px solid #e5e5e5
            }

            .mod-ct .detail .arrow .ico-arrow {
                display: inline-block;
                width: 20px;
                height: 11px;
                background: url("/ewm/img/wechat-pay.png") -25px -100px no-repeat
            }

            .mod-ct .detail-open .arrow .ico-arrow {
                display: inline-block;
                width: 20px;
                height: 11px;
                background: url("/ewm/img/wechat-pay.png") 0 -100px no-repeat
            }

            .mod-ct .detail-open .detail-ct {
                display: block
            }

            .mod-ct .tip {
                margin-top: 20px;
                border-top: 1px dashed #e5e5e5;
                padding: 10px 0;
                position: relative
            }

            .mod-ct .tip .ico-scan {
                display: inline-block;
                width: 56px;
                height: 55px;
                background: url("/ewm/img/wechat-pay.png") 0 0 no-repeat;
                vertical-align: middle;
                *display: inline;
                *zoom: 1
            }

            .mod-ct .tip .tip-text {
                display: inline-block;
                vertical-align: middle;
                text-align: left;
                margin-left: 23px;
                font-size: 16px;
                line-height: 28px;
                *display: inline;
                *zoom: 1
            }

            .mod-ct .tip .dec {
                display: inline-block;
                width: 22px;
                height: 45px;
                background: url("/ewm/img/wechat-pay.png") 0 -55px no-repeat;
                position: absolute;
                top: -23px
            }

            .mod-ct .tip .dec-left {
                background-position: 0 -55px;
                left: -136px
            }

            .mod-ct .tip .dec-right {
                background-position: -25px -55px;
                right: -136px
            }

            .foot {
                text-align: center;
                margin: 30px auto;
                color: #888888;
                font-size: 12px;
                line-height: 20px;
                font-family: "simsun"
            }

            .copyRight {
                text-align: center;
                color: #888888;
                margin-bottom: 1px;
            }

            .copyRight a {
                color: #888888;
            }

            h1 {
                font-family: "微软雅黑";
                font-size: 12px;
                margin: 5px 0;
                padding-bottom: 2px;
                letter-spacing: 2px;
            }

            .time-item strong {
                background: #3ec742;
                color: #fff;
                line-height: 25px;
                font-size: 28px;
                font-family: Arial;
                padding: 0 10px;
                margin-right: 10px;
                border-radius: 5px;
                box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
            }

            .item-title {
                background: none;
                line-height: 25px;
                font-size: 24px;
                padding: 0 10px;
                float: left;
            }

            .paybtn {
                display: inline-block;
                width: 100%;
                height: 80px;
                vertical-align: middle;
                padding-top: 10%;
                margin-right: 7px
            }


            .submit_alipay {
                font-size: 16px;
                font-family: Arial;
                font-weight: normal;
                -moz-border-radius: 5px;
                -webkit-border-radius: 5px;
                border-radius: 5px;
                border: 1px solid #84bbf3;
                padding: 9px 76px;
                text-decoration: none;
                background: -moz-linear-gradient(center top, #79bbff 105%, #378de5 0%);
                background: -ms-linear-gradient(top, #79bbff 105%, #378de5 0%);
                filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#79bbff', endColorstr='#378de5');
                background: -webkit-gradient(linear, left top, left bottom, color-stop(105%, #79bbff), color-stop(0%, #378de5));
                background-color: #79bbff;
                color: #ffffff;
                display: inline-block;
                text-shadow: 1px 1px 0px #528ecc;
                -webkit-box-shadow: 0px 0px 0px 0px #bbdaf7;
                -moz-box-shadow: 0px 0px 0px 0px #bbdaf7;
                box-shadow: 0px 0px 0px 0px #bbdaf7;
            }

            .submit_alipay:active {
                position: relative;
                top: 1px;
            }

            .btn {
                display: inline-block;
                padding: 6px 12px;
                margin-bottom: 0;
                font-size: 14px;
                font-weight: normal;
                line-height: 1.42857143;
                text-align: center;
                width: 80%;
                white-space: nowrap;
                vertical-align: middle;
                cursor: pointer;
                -webkit-user-select: none;
                -moz-user-select: none;
                -ms-user-select: none;
                user-select: none;
                background-image: none;
                border: 1px solid transparent;
                border-radius: 4px;
            }

            .btn:focus,
            .btn:active:focus,
            .btn.active:focus {
                outline: thin dotted;
                outline: 5px auto -webkit-focus-ring-color;
                outline-offset: -2px;
            }

            .btn:hover,
            .btn:focus {
                color: #333;
                text-decoration: none;
            }

            .btn:active,
            .btn.active {
                background-image: none;
                outline: 0;
                -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
                box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
            }

            .btn.disabled,
            .btn[disabled],
            fieldset[disabled] .btn {
                pointer-events: none;
                cursor: not-allowed;
                filter: alpha(opacity=65);
                -webkit-box-shadow: none;
                box-shadow: none;
                opacity: .65;
            }

            .btn-primary {
                color: #fff;
                background-color: #428bca;
                border-color: #357ebd;
            }

            .btn-primary:hover,
            .btn-primary:focus,
            .btn-primary:active,
            .btn-primary.active,
            .open > .dropdown-toggle.btn-primary {
                color: #fff;
                background-color: #3071a9;
                border-color: #285e8e;
            }

            .btn-primary:active,
            .btn-primary.active,
            .open > .dropdown-toggle.btn-primary {
                background-image: none;
            }

            .btn-primary .badge {
                color: #428bca;
                background-color: #fff;
            }

            /* This css button was generated by css-button-generator.com */

        </style>
    </head>

    <body>
        <div class="body">
            <h1 class="mod-title">
                <span class="ico_log ico-3"></span>
            </h1>

            <div class="mod-ct">
                <div class="order">
                </div>
                <div class="amount" id="money">￥{$cash}</div>

                <div class="qrcode-img-wrapper" data-role="qrPayImgWrapper">
                    <div data-role="qrPayImg" class="qrcode-img-area">
                        <div class="ui-loading qrcode-loading" data-role="qrPayImgLoading" style="display: none;"></div>
                        <div style="position: relative;display: inline-block;">
                            <img id="show_qrcode" src="{$img}" width="210" height="210" style="display: block;">
                            <img onclick="$('#use').hide()" id="use" src="/ewm/img/logo_weixin.png"  style="position: absolute;top: 50%;left: 50%;width:32px;height:32px;margin-left: -16px;margin-top: -16px">
                            <div id="qrcode" style="display: none;"></div>
                            <canvas id="imgCanvas" width="210" height="250" style="display: none;"></canvas>
                        </div>
                    </div>
                </div>

                <div class="payweixinbtn" style="display: none;">
                    <a download id="downloadbtn" class="btn btn-primary">先截图保存二维码到手机相册</a>
                </div>

                <div class="payweixinbtn" style="display: none;padding-top: 10px">
                    <a href="weixin://" class="btn btn-primary">点击打开微信，扫一扫相册图片</a>
                </div>

                <div class="iospayweixinbtn" style="display: none;">1.长按上面的图片然后"存储图像"</div>
                <div class="iospayweixinbtn" style="display: none;padding-top: 10px">
                    <a href="weixin://scanqrcode" class="btn btn-primary">2.打开微信，扫一扫本地图片</a>
                </div>

                <div class="tip" style="color: red;font-size:20px;">
                    <div class="ico-scan"></div>
                    <div class="tip-text">
                        <p id="showtext">打开微信 [扫一扫]</p>
                    </div>
                </div>

                <div class="time-item" style="padding-top: 10px">
                    <div class="time-item" id="msg"><h1>付款3分钟内到账，未到账请联系来源APP客服</h1></div>
                    <div class="time-item"><h1>订单:{$order_id}</h1></div>
                    <strong id="hour_show">0时</strong>
                    <strong id="minute_show">0分</strong>
                    <strong id="second_show">0秒</strong>
                </div>

                <div class="tip-text">
                </div>

            </div>
            <div class="foot">
                <div class="inner" style="display:none;">
                    <p>手机用户可保存上方二维码到手机中</p>
                    <p>在微信扫一扫中选择“相册”即可</p>
                    <p></p>
                </div>
            </div>

        </div>
        <div class="copyRight">
            <p>Powered by <a href="#" >微信扫码</a></p>
        </div>
        <br>
        <script type="text/javascript">
            var priceIstype = '1';

            var myTimer;
            var strcode = '';

            function timer(intDiff) {
                myTimer = window.setInterval(function () {
                    var day = 0,
                            hour = 0,
                            minute = 0,
                            second = 0;//时间默认值
                    if (intDiff > 0) {
                        day = Math.floor(intDiff / (60 * 60 * 24));
                        hour = Math.floor(intDiff / (60 * 60)) - (day * 24);
                        minute = Math.floor(intDiff / 60) - (day * 24 * 60) - (hour * 60);
                        second = Math.floor(intDiff) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60);
                    }
                    if (minute <= 9)
                        minute = '0' + minute;
                    if (second <= 9)
                        second = '0' + second;
                    $('#hour_show').html('<s id="h"></s>' + hour + '时');
                    $('#minute_show').html('<s></s>' + minute + '分');
                    $('#second_show').html('<s></s>' + second + '秒');
                    if (hour <= 0 && minute <= 0 && second <= 0) {
                        qrcode_timeout();
                        clearInterval(myTimer);
                    }
                    intDiff--;

                    if (strcode != "") {
                        checkdata();
                    }

                }, 1000);
            }

            function qrcode_timeout() {
                $('#show_qrcode').attr("src", "/ewm/img/qrcode_timeout.png");
                $("#use").hide();
                $('#msg').html("<h1>支付已超时</h1>");

            }

            function isWeixin() {
                var ua = window.navigator.userAgent.toLowerCase();
                if (ua.match(/MicroMessenger/i) == 'micromessenger') {
                    return 1;
                } else {
                    return 0;
                }
            }

            function isMobile() {
                var ua = navigator.userAgent.toLowerCase();
                _long_matches = 'googlebot-mobile|android|avantgo|blackberry|blazer|elaine|hiptop|ip(hone|od)|kindle|midp|mmp|mobile|o2|opera mini|palm( os)?|pda|plucker|pocket|psp|smartphone|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce; (iemobile|ppc)|xiino|maemo|fennec';
                _long_matches = new RegExp(_long_matches);
                _short_matches = '1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-';
                _short_matches = new RegExp(_short_matches);
                if (_long_matches.test(ua)) {
                    return 1;
                }
                user_agent = ua.substring(0, 4);
                if (_short_matches.test(user_agent)) {
                    return 1;
                }
                return 0;
            }


            $().ready(function () {

                // 获取服务器端倒计时时间begin
                var expiretime = {$expire_time};// 获取服务器返回的时间 测试5s todo change
                timer(expiretime);
                var istype = "1";
                var suremoney = "1";
                var uaa = navigator.userAgent;
                var isiOS = !!uaa.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
                if (isMobile() == 1) {
                    if (isWeixin() == 1 && istype == 2) {
                        //微信内置浏览器+微信支付
                        $("#showtext").text("长按二维码识别");
                    } else {
                        //其他手机浏览器+支付宝支付
                        if (isWeixin() == 0 && istype == 1) {
                            $(".paybtn").attr('style', '');
                            $('#msg').html("<h1>付款3分钟内到账，未到账请联系来源APP客服</h1>");
                            $(".tip").html(
                                    "先截图保存二维码到手机相册<br>\n" +
                                    "<a href='weixin://'>点击打开微信，扫一扫相册图片</a>");
                            $(".foot").remove();

                        } else {
                            if (isWeixin() == 0 && istype == 2) {
                                //其他手机浏览器+微信支付
                                //IOS的排除掉
                                if (isiOS) {
                                    $('.iospayweixinbtn').attr('style', 'padding-top: 15px;');
                                } else {
                                    $(".payweixinbtn").attr('style', 'padding-top: 15px;');
                                }
                                $("#showtext").html("请保存二维码到手机<br>微信扫一扫点右上角-从相册选取");
                            }
                        }
                    }
                }

            });

        </script>
    </body>
</html>
